from datetime import date
from enum import Enum
from typing import Optional

from pydantic import BaseModel


class BoardCategory(Enum):
    orderCabinet = 1
    waterproofboard = 2
    orderdoor = 3


class Piece(BaseModel):
    bar_code: str  # "DDY00006612A1030",
    code: str  # "M",
    dailyplan: str  # "DC2-2112270005",
    datatime: date  # "2021-12-27",
    depart_num: str  # "JPOOOO02-M1",
    id: int  # 0,
    length: int  # 797,
    material_no: str  # "BC071133",
    material_type: str  # "16MM暖白中麻多层板E1",
    optimization_type: str  # "Y004",
    order_number: str  # "DDY00006612A",
    params: Optional[dict] = None  # {},
    process: str  # "01CS6-0T",
    production_type: str  # "M004",
    quantity: int  # 1,
    section_name: str  # "镜框_竖框架",
    status: int  # 0,
    texture: int  # 1,
    tricks: str #"阿尔卑斯2",
    width: int  # 90,
    work_order: str  # "DDY00006612A",
    cutting_time: str  # "2021-12-7",
    specification: str  # "2240,1220,4"
